package com.daoeping.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * Usr_userdetailinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "usr_userdetailinfo", catalog = "daoeping")
public class Usr_userdetailinfo implements java.io.Serializable {

	// Fields

	private Integer id;
	//private Integer userId;
	private Usr_user usr_user;
	private String name;
	private String idcard;
	private String birthday;
	private String phone;
	private String address;

	// Constructors

	/** default constructor */
	public Usr_userdetailinfo() {
	}


	/** minimal constructor */
	/*public Usr_userdetailinfo(Integer userId, String name, String idcard) {
		this.userId = userId;
		this.name = name;
		this.idcard = idcard;
	}

	/** full constructor */
	public Usr_userdetailinfo(Usr_user usr_user, String name, String idcard,
			String birthday, String phone, String address) {
		this.usr_user = usr_user;
		this.name = name;
		this.idcard = idcard;
		this.birthday = birthday;
		this.phone = phone;
		this.address = address;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}


	@OneToOne(optional= true, cascade = CascadeType.ALL, fetch= FetchType.LAZY)
	@JoinColumn(name="user_id")
	public Usr_user getUsr_user() {
		return usr_user;
	}

	public void setUsr_user(Usr_user usr_user) {
		this.usr_user = usr_user;
	}


	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "idcard", nullable = false, length = 50)
	public String getIdcard() {
		return this.idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	@Column(name = "birthday", length = 20)
	public String getBirthday() {
		return this.birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	@Column(name = "phone", length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "address", length = 200)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

}